import request from '@/utils/request'

export function add(data) {
  return request.post('admin/moduleformfield/add', data)
}

export function del(data) {
  return request.post('admin/moduleformfield/del', data)
}

export function edit(data) {
  return request.post('admin/moduleformfield/edit', data)
}

export function getTablePage(data) {
  return request.post('admin/moduleformfield/listPage', data)
}

export function loadModuleData(data) {
  return request.post('admin/moduleform/loadModuleData?id=' + data, data)
}

export function genFormData(data) {
  return request.post('admin/moduleformfield/genFormData?moduleFormId=' + data.moduleFormId + '&tableName=' + data.tableName, data)
}

export function doCrud(data) {
  return request.post('admin/moduleformfield/doCrud?type=' + data.type + '&sql=' + data.sql + '&paramsJson=' + data.paramsJson, data)
}

export function addFormAndFormField(data) {
  return request.post('admin/moduleformfield/addFormAndFormField', data)
}

export function editFormAndFormField(data) {
  return request.post('admin/moduleformfield/editFormAndFormField', data)
}

export default {add, del, edit, genFormData, doCrud, addFormAndFormField, editFormAndFormField, getTablePage}
